<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<title>Media Query 3 Column App</title>
		<script type="text/javascript" src="../../../../../dojox/mobile/deviceTheme.js"></script>
		<script type="text/javascript">
			dojoConfig = {
				parseOnLoad: false,
				mblHideAddressBar: false,
				mblAndroidWorkaround: false,
                mblAlwaysHideAddressBar: false,	
				async:1,
				app: {debugApp: 0}  // set debugApp to log app transitions and view activate/deactivate
			};
		</script>
		<script type="text/javascript" src="../../../../../dojo/dojo.js"></script>

		<script>
            // the actual  launcher
            require(["../../domOrderByConstraint/domOrderByConstraint.js"], function(){});
        </script>
		<script type="text/javascript">
			require([
				"doh/runner",
				"dojo/topic",
				"dojo/_base/lang",
				"dojo/dom",
				"dojox/mobile/TransitionEvent",				
				"dijit/registry"
			], function(doh, topic, lang, dom, TransitionEvent, registry) {
				var events = [];

				var getLabelfromWid = function(wid, indx1, indx2){
					var val = wid.labelNode.innerText || wid.labelNode.firstChild.nodeValue || "";
					val = lang.trim(val);
					if(indx2){
						val = val.substring(indx1,indx2)
					}
					return val;
				};

				topic.subscribe("/app/status", lang.hitch(this, function(newStatus) {
					events.push(newStatus);
					if (newStatus == 2) {
						var listItem_0TestStr = "Main Option 1";
						var listItem_1TestStr = "Main Option 2";
						doh.register("Test-domOrderByConstraint1", [{
							// Test initial values
							name : "initial-domNodeLayout",
							runTest : function() {
							var dfd = new doh.Deferred();
								setTimeout(function() {
									var footerDom = dom.byId("domOrderByConstraint_footer");
									doh.is(footerDom.firstElementChild.id, "domOrderByConstraint_footer_header",
											"firstElem of footer should be footer_header");
									doh.is(footerDom.lastElementChild.id, "mainTabBar",
											"lastElem of footer should be mainTabBar");
									var footerHeaderDom = dom.byId("domOrderByConstraint_footer_header");
									doh.is(footerHeaderDom.firstElementChild.id, "dojox_mobile_Heading_0",
											"firstElem of footerHeader should be dojox_mobile_Heading_0");
									doh.is(footerHeaderDom.lastElementChild.id, "domOrderByConstraint_footer_header_right",
											"lastElem of footerHeader should be domOrderByConstraint_footer_header_right");
									var footerHeaderRightDom = dom.byId("domOrderByConstraint_footer_header_right");
									doh.is(footerHeaderRightDom.firstElementChild.id, "domOrderByConstraint_footer_header_right_left",
											"firstElem of footerHeaderRight should be domOrderByConstraint_footer_header_right_left");
									doh.is(footerHeaderRightDom.lastElementChild.id, "dojox_app_widgets_Container_0",
											"lastElem of footerHeaderRight should be dojox_app_widgets_Container_0");
									var footerHeaderRightLeftDom = dom.byId("domOrderByConstraint_footer_header_right_left");
									doh.is(footerHeaderRightLeftDom.firstElementChild.id, "dojox_app_widgets_Container_1",
											"firstElem of footerHeaderRightLeft should be dojox_app_widgets_Container_1");
									doh.is(footerHeaderRightLeftDom.lastElementChild.id, "domOrderByConstraint_footer_header_right_left_center",
											"lastElem of footerHeaderRightLeft should be domOrderByConstraint_footer_header_right_left_center");
									return dfd.callback(true);
								}, 500);
								return dfd;
							}
						}
						]);
						doh.run();
					}
				}));
			});
		</script>
	</head>
	<body>
	</body>
</html>
